package com.tistory.credit.service;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tistory.common.vo.CommonReq;
import com.tistory.credit.dao.CreditDao;
import com.tistory.credit.vo.CreditDetailInfo;
import com.tistory.credit.vo.CreditReq;
import com.tistory.credit.vo.CreditRes;

@Service("CreditServiceImpl")
public class CreditServiceImpl implements CreditService {

	@Autowired
	CreditDao creditDao;

	/**
	 * @param creditDao the creditDao to set
	 */
	public void setCreditDao(CreditDao creditDao) {
		this.creditDao = creditDao;
	}

	@Override
	public List<CreditRes> getCreditMainList(CommonReq req) throws SQLException {

		List<CreditRes> creditMainList = creditDao.getCreditMainList(req);
		return creditMainList;
	}

	@Override
	public Integer getCreditMainListCount(CommonReq req) throws SQLException {
		return  creditDao.getCreditMainListCount(req);
	}


	@Override
	public Integer insertCreditInfo(List<CreditReq>creditList) throws SQLException {
		// TODO Auto-generated method stub
		return creditDao.insertCreditInfo(creditList);
	}

	@Override
	public Integer insertCreditCardInfo(List<CreditReq>creditList) throws SQLException {
		// TODO Auto-generated method stub
		return creditDao.insertCreditCardInfo(creditList);
	}

	@Override
	public List<CreditReq> getCardSumList(String userId) throws SQLException {

		List<CreditReq>cardSumList = creditDao.getCardSumList(userId);
		return cardSumList;
	}	

	@Override
	public List<CreditReq> getWithDrawInfoList(CommonReq req) throws SQLException {

		List<CreditReq>withDrawInfoList = creditDao.getWithDrawInfoList(req);
		return withDrawInfoList;
	}

	@Override
	public List<CreditDetailInfo> getWithDrawDetailInfoList(CommonReq req) throws SQLException {
		List<CreditDetailInfo> withDrawDetailInfoList = creditDao.getWithDrawDetailInfoList(req);
		return withDrawDetailInfoList;	
	}

	@Override
	public List<CreditReq> getCardWithDrawDetailInfo(Map<String, Object> map)throws SQLException {
		List<CreditReq> cardWithDrawDetailInfo = creditDao.getCardWithDrawDetailInfo(map);
		return cardWithDrawDetailInfo;	
	}

	@Override
	public List<CreditReq> getCardBillDetailInfoList(Map<String,Object> map) throws SQLException {
		List<CreditReq> cardBillDetailInfoList = creditDao.getCardBillDetailInfoList(map);
		return cardBillDetailInfoList;	
	}	
	@Override
	public List<CreditReq> getCardBillSeperateDetailInfo(Map<String, Object> map)throws SQLException {
		List<CreditReq> cardBillSeperateDetailInfo = creditDao.getCardBillSeperateDetailInfo(map);
		return cardBillSeperateDetailInfo;	
	}
	public Integer deleteCreditInfo(Map<String,Object> map) throws SQLException{
		return  creditDao.deleteCreditInfo(map);
	}
	@Override
	public Integer insertCreditRealCardInfo(List<CreditReq>creditList) throws SQLException {
		// TODO Auto-generated method stub
		return creditDao.insertCreditRealCardInfo(creditList);
	}
	
	@Override
	public Integer insertCreditRealBankInfo(List<CreditReq>creditList) throws SQLException {
		// TODO Auto-generated method stub
		return creditDao.insertCreditRealBankInfo(creditList);
	}
	@Override
	public List<CreditReq> getMinusListDetailInfo(Map<String, Object> map)throws SQLException {
		List<CreditReq> minusListDetailInfo = creditDao.getMinusListDetailInfo(map);
		return minusListDetailInfo;	
	}

	public void insertPay(Map<String,Object> map) throws SQLException{
		creditDao.insertPay(map);
	}
	
	@Override
	public CreditReq getMinusDetailInfo(Map<String, Object> map)throws SQLException {
		CreditReq minusDetailInfo = creditDao.getMinusDetailInfo(map);
		return minusDetailInfo;	
	}
	

	@Override
	public List<CreditRes> getRealBankList(CommonReq req) throws SQLException {

		List<CreditRes> creditMainList = creditDao.getRealBankList(req);
		return creditMainList;
	}
	
	@Override
	public List<CreditReq> getCardFeeDetailInfo(Map<String, Object> map)throws SQLException {
		List<CreditReq> cardFeeDetailInfo = creditDao.getCardFeeDetailInfo(map);
		return cardFeeDetailInfo;	
	}
	
	@Override
	public List<CreditReq> getMinusPayList(CommonReq req) throws SQLException {
		List<CreditReq> minusPayList = creditDao.getMinusPayList(req);
		return minusPayList;
	}
	
	public void updateChangeData(Map<String,Object> map) throws SQLException{
		creditDao.updateChangeData(map);
	}
	
	@Override
	public List<CreditReq> getPayProcessList(CommonReq req) throws SQLException {
		List<CreditReq> payProecssList = creditDao.getPayProecssList(req);
		return payProecssList;
	}	
	
}
